#get tag name from autocomplete (name _ type)
get_tag_name=lambda x: x.split()[0]

#get instance of tag from name
get_tag_from_name=lambda x: Tag.objects.filter(name__exact=x)[0]

#get instance of note from id
get_note_from_id=lambda x: Note.objects.filter(id=x)[0]
